class Fruit(object):
    def makejuice(self):
        print('i can make juice')

class Apple(Fruit):
    def makejuice(self):
        print('i can make apple juice')

class Banana(Fruit):
    def makejuice(self):
        print('i can make banana juice')

class Orange(Fruit):
    def makejuice(self):
        print('i can make orange juice')

class Peach(Fruit):
    print('i can peach juice')


##定义公共方法service

def service(obj):
    obj.makejuice()


apple=Apple()

banana=Banana()
orange=Orange()

for i in (apple,banana,orange):
    service(i)
